#include "stdafx.h"
#include "Sphere.h"

using namespace unigame;

bool Sphere::isIntersect(Vector3f& point)
{
	float x = point.x - m_center.x;
	float y = point.y - m_center.y;
	float z = point.z - m_center.z;
	return x * x + y * y + z * z < m_radius * m_radius;
}

bool Sphere::isIntersectOrOnEdge(Vector3f& point)
{
	float x = point.x - m_center.x;
	float y = point.y - m_center.y;
	float z = point.z - m_center.z;
	return x * x + y * y + z * z <= m_radius * m_radius;
}